# 配置日志
import logging


import logging

def logger_config():
    logging.basicConfig(
        level=logging.INFO,
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
        handlers=[
            logging.FileHandler('spider.log', encoding='utf-8'),  # 日志文件
            logging.StreamHandler()  # 控制台输出
        ]
    )